The present invention relates to a method of and an apparatus for inspecting or measuring a size of an object in a contactless manner using, for example, a two-dimensional sensor such as a video camera, and in particular, to a size inspection or measurement method and a size inspection or measurement apparatus suitable for inspecting or measuring an object using an image thereof enlarged by, for example, an optical microscope.
For example, JP-B-6-103168 describes a basic configuration of a size inspection/measurement apparatus. In the apparatus, as can be seen from FIG. 2, an image of an object 2 projected by an optical microscopy 1 is picked up by a video camera 3. A size measurement processor 40 electrically measures sizes of desired sections of the image obtained by the video camera 3. The image and values of sizes of the object 2 are displayed on a video monitor 5.
FIG. 3 shows an example of an image displayed on a screen of the video monitor 5 during the size measurement. L1 to Li indicate scanning lines. As shown in FIG. 3, for each horizontal scanning line Li of an image 55 of the object 2 picked up by the video camera 3 and displayed on the video monitor 5, a luminance-pixel characteristic is obtained for each pixel position determined by dividing a video signal of the scanning line Li by N and according to luminance of the pixel position. FIG. 4 shows a graph of the luminance-pixel characteristic in which an ordinate indicates luminance and an abscissa indicates pixel positions. The sizes are obtained according to the characteristic in a processing method of the prior art. In the luminance distribution of FIG. 4, a maximum luminance level 51 and a minimum luminance level 52 are assumed to be 100% and 0%, respectively. A positional difference Nab between an a-th pixel and a b-th pixel, which each correspond to a luminance level Vsl of 50% of the maximum luminance level 51, is obtained. The positional difference Nab is multiplied by a coefficient k determined according to a magnification factor of the microscope 1 and a distance between the video camera 3 and the object 2 to obtain a value of size X of the object 2. Namely, X=Kxc2x7Nab is calculated.
The technique of the prior art has been employed to measure width of a line. That is, as can be seen from FIG. 3, the object of which sizes are to be measured is clear and hence a width of the object 2 can be obtained. Therefore, by setting an upper limit value and a lower limit value to the size, acceptability of the object to be measured can be determined, that is, good/bad decisign of the object can be made. In the prior art example, it is assumed that a contour of the object is vertical to the measuring direction.
However, in a case in which the object 25 has rounded corners as shown in FIG. 5 or in which the image is obscure because the optical microscope is used with a magnification factor near its limit, when it is desired to determine by the apparatus whether or not its size is in a range of predetermined values or whether or not its contour is acceptable, measurement of sizes of the object 25 and determination of acceptability of the contour of the object 25 become difficult for the following reasons.
When it is desired to measure length, for example, from a corner c to a corner d of the object 25, it is difficult to identify a scanning line to measure the length between the corners and the measurement is attended with a large amount of error. As can be seen from FIG. 5, it can be appreciated that line width Wi measured using the scanning line Li is less than line width Wi+n measured using the scanning line Li+n. That is, between Wi measured by assuming that angles c and d are on the scanning line Li and Wi+n measured by assuming that angles c and d are on the scanning line Li, an error of Wixe2x88x92Wi+n appears.
Even if n is assumed to be one, the error for one scanning line takes place easily when the object 25 is moved only by slight vibration of the measurement apparatus.
It is therefore an object of the present invention to provide a size inspection or measurement method and a size inspection or measurement apparatus which can measure sizes of an object of which a measurement position is not easily determined and which can determine acceptability of the contour of the object.
To achieve the object, there is provided a size inspection or measurement method according to one aspect of the present invention including a step, in a teaching stage, of inspecting an acceptable or good item or of detecting a contour of an object to be measured and a step of registering positions of the contour detected and thereby preparing reference contour positions registered. In the inspection or the measurement, the reference registered positions are compared with positions of a contour of an inspection or measurement object and then positions having highest correlation with the reference registered positions are set as contour positions of a size measurement location. For example, contours of reference angles are beforehand registered. In the measurement of an inspection object, a position having highest correlation with respect to the registered contour of angle is detected and is set as a position of an angle and another angle is detected in a similar fashion to inspect or to measure a size between these angles.